package be.jprojects.tests.filter;

import java.awt.Component;

import javax.swing.ImageIcon;
import javax.swing.JList;
import javax.swing.ListCellRenderer;

public class EmptyListCellRenderer implements ListCellRenderer {
	private static ImageIcon icon = new ImageIcon("Resources/null.png");

	@Override
	public Component getListCellRendererComponent(JList list, Object value,
			int index, boolean isSelected, boolean cellHasFocus) {

		FilterItemPanel fip = new FilterItemPanel();
		fip.setIcon(icon);
		if (value == null) {
			fip.setTitle("[Empty]");
		} else {
			fip.setTitle(value.toString());
			fip.setInfo(value.toString());
		}
		
		return fip;
	}

}
